import { Component } from './zreact/component'
import React from './zreact/index'
import ReactDOM from './zreact/react-dom'

class ClassComponent extends Component {
    render() {
        return (
            <div>
                <h1>hello {this.props.name}</h1>
            </div>
        )
    }
}

function FunctionComponent(props) {
    return (
        <div>
            hello
            <h1>我是函数组件{ props.name }</h1>
        </div>
    )
}

const jsx = (
    <div>
        <p className="name">hello</p>
        <h1>我是源码</h1>
        我是文本节点
        <ClassComponent name={'zhuyaogeng'} />
        <FunctionComponent name="react" />
    </div>
)

ReactDOM.render(jsx, document.getElementById('root'))
